package com.you.atlas.web.member.module.screen;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.Navigator;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.you.atlas.biz.place.service.AlbumQueryService;
import com.you.atlas.web.common.util.ListUtil;
import com.you.atlas.web.common.util.ListVO;
import com.you.atlas.web.member.module.MemberModule;
import com.you.common.ibatis.data.DataList;

public class PhotoList extends MemberModule {

    @Autowired
    private AlbumQueryService albumQueryService;

    public void execute(@Param("pageNo") int pageNo, @Param("id") Long memberId, Context context,
                        Navigator navigator) {
        if (!checkAuth(memberId, navigator, context)) {
            return;
        }
        DataList dataList = albumQueryService.queryAlbumByMemberId(pageNo, 15, memberId);
        context.put("dataList", dataList);
        ListVO photoList = ListUtil.split(dataList.getData());
        context.put("dataList", dataList);
        context.put("dataList1", photoList.getDataList1());
        context.put("dataList2", photoList.getDataList2());
        context.put("dataList3", photoList.getDataList3());
    }
}
